import { ref, computed } from 'vue'
import { defineStore } from 'pinia'

export const useCounterStore = defineStore('counter', () => {
  const url = ref('')
  // 定义actions来修改状态  
  const actions = {
    setUrl(newUrl: any) {
      url.value = newUrl;
    }
  };

  return {
    url, ...actions // 将actions展开，使其方法可以直接在store上调用 
  }
})
